import request from '@/utils/request'

// 查询电子围栏列表
export function listPrence(query) {
  return request({
    url: '/electric/fence/list',
    method: 'get',
    params: query
  })
}

// 查询电子围栏详细
export function getPrence(brandId) {
    return request({
      url: '/electric/fence/' + brandId,
      method: 'get'
    })
  }

// 新增电子围栏
export function addPrence(data) {
    return request({
      url: '/electric/fence',
      method: 'post',
      data: data
    })
  }
  
  // 修改电子围栏
  export function updatePrence(data) {
    return request({
      url: '/electric/fence',
      method: 'put',
      data: data
    })
  }
  
  // 删除电子围栏
  export function delPrence(brandId) {
    return request({
      url: '/electric/fence/' + brandId,
      method: 'delete'
    })
  }

  // 查询围栏绑定设备列表
export function listDevice(query) {
    return request({
      url: '/car/information/deviceList',
      method: 'get',
      params: query
    })
  }

    // 查询已绑定设备列表
export function listBindDevice(query) {
    return request({
      url: '/fence/device/list',
      method: 'get',
      params: query
    })
  }

  // 新增围栏绑定设备
export function addBind(data) {
    return request({
      url: '/fence/device/binding',
      method: 'post',
      data: data
    })
  }
  
  // 修改围栏绑定设备
  export function updateBind(data) {
    return request({
      url: '/fence/device/unbind',
      method: 'post',
      data: data
    })
  }